package com.guchenbo.erp.inventory.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.guchenbo.erp.dao.entity.ErpBaseModel;
import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * <p>
 * 库存表
 * </p>
 *
 * @author guchenbo
 * @since 2025-07-12
 */
public class Inventory extends ErpBaseModel {

    /**
     * 库存记录ID
     */
    @TableId(value = "inventory_id", type = IdType.AUTO)
    private Long inventoryId;

    /**
     * 商品ID
     */
    private Long productId;

    /**
     * 仓库ID
     */
    private Long warehouseId;

    /**
     * 批次号（可选）
     */
    private String batchNo;

    /**
     * 总库存数量
     */
    private BigDecimal quantity;

    /**
     * 可用库存
     */
    private BigDecimal availableQty;

    /**
     * 冻结库存（锁定库存）
     */
    private BigDecimal frozenQty;

    /**
     * 有效期（生鲜/药品可用）
     */
    private LocalDate expirationDate;

    public Long getInventoryId() {
        return inventoryId;
    }

    public void setInventoryId(Long inventoryId) {
        this.inventoryId = inventoryId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Long getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(Long warehouseId) {
        this.warehouseId = warehouseId;
    }

    public String getBatchNo() {
        return batchNo;
    }

    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }

    public BigDecimal getQuantity() {
        return quantity;
    }

    public void setQuantity(BigDecimal quantity) {
        this.quantity = quantity;
    }

    public BigDecimal getAvailableQty() {
        return availableQty;
    }

    public void setAvailableQty(BigDecimal availableQty) {
        this.availableQty = availableQty;
    }

    public BigDecimal getFrozenQty() {
        return frozenQty;
    }

    public void setFrozenQty(BigDecimal frozenQty) {
        this.frozenQty = frozenQty;
    }

    public LocalDate getExpirationDate() {
        return expirationDate;
    }

    public void setExpirationDate(LocalDate expirationDate) {
        this.expirationDate = expirationDate;
    }

    @Override
    public String toString() {
        return "Inventory{" +
            "inventoryId = " + inventoryId +
            ", productId = " + productId +
            ", warehouseId = " + warehouseId +
            ", batchNo = " + batchNo +
            ", quantity = " + quantity +
            ", availableQty = " + availableQty +
            ", frozenQty = " + frozenQty +
            ", expirationDate = " + expirationDate +
        "}";
    }
}
